﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;

namespace df
{
    public partial class change_pw : share
    {
        public change_pw()
        {
            InitializeComponent();


            name.Text = config.cloudNm;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Dispose();
        }

        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            if (password.Text != password_confirm.Text)
            {
                err.Text = "两次输入的密码不一样";


                return;
            }

            var para = new Dictionary<string, object>();            
            para.Add("pw", password.Text);
            var rt = post(config.change_pw, para);
            if (rt != null)
            {
                err(err, rt["msg"].ToString());
                
                if (rt["status"].ToInt32() > 0)
                {
                    DialogResult = DialogResult.OK;
                }



            }


        }
    }
}
